package cn.echoparrot.application;

import cn.echoparrot.domain.entity.Dataset;

import cn.echoparrot.repository.neo4j.DatasetMapper;
import org.springframework.ai.document.Document;
import org.springframework.ai.embedding.EmbeddingModel;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 将向量检索知识库功能封装为一个工具类，供大模型使用
 *
 */
public class RetrievalTool {
    private final Dataset dataset;
    private final DatasetMapper datasetMapper;

    @Autowired
    private EmbeddingModel embeddingModel;

    public RetrievalTool(DatasetMapper datasetMapper,Dataset dataset){
        this.dataset = dataset;
        this.datasetMapper = datasetMapper;
    }

    @Tool(description = "Retrieve relative documents from knowledge base")
    public List<Document> retrieve(String query){
        // TODO
        return null;
    }
}
